<%@page contentType="text/html; charset=utf-8"%>
<%@ include file="../inc/TagLibs.jsp"%>
<c:set var="pageTitle" value="调拨单" />
<%@ include file="../inc/Title.jsp"%>
<head>
<link href="/calendar/dhtmlgoodies_calendar/dhtmlgoodies_calendar.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="/css/BillEdit.css" />
<script src="/js/popup_ext.js"></script>
<script src="/calendar/dhtmlgoodies_calendar/dhtmlgoodies_calendar.js"></script>
<script language="javascript">
	function doSave(flag){
		document.getElementById("buttonDiv").style.display="none";
		document.getElementById("waitDiv").style.display="";
		document.getElementById("continue_flag").value=flag;
		<c:if test="${currentUser.user.userType==1 || fn:indexOf(currentUser.privs,';ALLO_EXAM;')!=-1}">
			ShowConfirm('确认框','是否同时审核？',340,80,"doSaveCallBack()");
		</c:if>
		<c:if test="${currentUser.user.userType!=1 && fn:indexOf(currentUser.privs,';ALLO_EXAM;')==-1}">
			frm.submit();
		</c:if>
	}
	function doSaveCallBack(){
		if(popRetVal!=null){
			document.getElementById("examine").value="1";
		}
		frm.submit();
	}
	function doCancel(){
		if(window.opener){
			window.close();
		}else{
			parent.ClosePop();
		}
	}
	function elementOnChnage(){
		checkItemChange(this.getAttribute("index"),this.name);
	}
	function productOnChnage(){
		checkProductChange(this.getAttribute("index"));
	}
	function inputOnMouseOver(){
		this.title=this.value;
	}
	function checkProductChange(index){
		if(window.event.keyCode==13){
			var productName=document.getElementById("product_name_"+index).value;
			selectProduct(index,productName);
		}
	}
	function buttonOnClick(){
		selectProduct(this.getAttribute("index"),'');
	}
	function selectProduct(index,productName){
		var stoId=document.getElementById("alloBill.fromStoId").value;
		var url="/base/ProductMainForSelect.ihtm?search_key="+productName;
		if(stoId!="" && stoId!="0"){
			url=url+"&stock=Y&sto_id="+stoId;
		}
		ShowIframe("选择商品",url,900,500,"selectProductCallBack("+index+")",1024,600);
	}
	function selectProductCallBack(index){
		if(popRetVal!=null){
			document.getElementById("product_id_"+index).value=popRetVal[0];
			document.getElementById("product_code_"+index).value=popRetVal[1];
			document.getElementById("product_name_"+index).value=popRetVal[2];
			document.getElementById("product_unit_"+index).value=popRetVal[3];
			document.getElementById("amount_"+index).value=popRetVal[4];
			if(document.getElementById("unit_price_"+index)!=null){
				document.getElementById("unit_price_"+index).value="0";
				document.getElementById("cost_"+index).value="0";
			}
			checkItemChange(index,"amount_"+index);
		}
	}
	
	function doMultiSelect(index,productName){
		var stoId=document.getElementById("alloBill.fromStoId").value;
		var url="/base/ProductMainForSelect.ihtm?type=MULTI";
		if(stoId!="" && stoId!="0"){
			url=url+"&stock=Y&sto_id="+stoId;
		}
		ShowIframe("选择商品",url,900,500,"doMultiSelectCallBack()",1024,600);
	}
	function doMultiSelectCallBack(){
		if(popRetVal!=null){
			for(i=0;i<popRetVal.length;i++){
				var newIndex=doItemAdd();
				document.getElementById("product_id_"+newIndex).value=popRetVal[i][0];
				document.getElementById("product_code_"+newIndex).value=popRetVal[i][1];
				document.getElementById("product_name_"+newIndex).value=popRetVal[i][2];
				document.getElementById("product_unit_"+newIndex).value=popRetVal[i][3];
				document.getElementById("amount_"+newIndex).value=popRetVal[i][4];
				checkItemChange(newIndex);
		}
	}
	}
	function doItemAdd(){
		var tbl=document.getElementById("itemRowTbl");
		var itemNum=document.getElementById("item_num").value-0;

		var tr=document.createElement("tr");
		tr.setAttribute("id","itemTr"+itemNum);
		
		var td;
		var input;

		td=document.createElement("td");
		input=document.createElement("input");
		input.setAttribute("type","text");
		input.style.width="80px";
		input.setAttribute("index",itemNum);
		input.setAttribute("name","product_code_"+itemNum);
		input.setAttribute("id","product_code_"+itemNum);
		input.setAttribute("readOnly",true);
		input.setAttribute("className","TextBox readonly");
		input.setAttribute("class","TextBox readonly");
		td.appendChild(input);
		tr.appendChild(td);
		
		td=document.createElement("td");
		input=document.createElement("input");
		input.setAttribute("type","text");
		input.style.width="160px";
		input.setAttribute("index",itemNum);
		input.setAttribute("name","product_name_"+itemNum);
		input.setAttribute("id","product_name_"+itemNum);
		input.setAttribute("readOnly",true);
		input.setAttribute("className","TextBox readonly");
		input.setAttribute("class","TextBox readonly");
		input.onmouseover=inputOnMouseOver;
		td.appendChild(input);
		
		td.appendChild(document.createTextNode(" "));
		input=document.createElement("img");
		input.setAttribute("src","/images/icon_add.gif");
		input.setAttribute("index",itemNum);
		input.style.cursor="pointer";
		input.onclick=buttonOnClick;
		td.appendChild(input);
		
		input=document.createElement("input");
		input.setAttribute("type","hidden");
		input.setAttribute("name","product_id_"+itemNum);
		input.setAttribute("id","product_id_"+itemNum);
		input.setAttribute("value","0");
		td.appendChild(input);
		
		tr.appendChild(td);
		
		td=document.createElement("td");
		input=document.createElement("input");
		input.setAttribute("type","text");
		input.style.width="50px";
		input.setAttribute("index",itemNum);
		input.setAttribute("name","product_unit_"+itemNum);
		input.setAttribute("id","product_unit_"+itemNum);
		input.setAttribute("readOnly",true);
		input.setAttribute("className","TextBox readonly");
		input.setAttribute("class","TextBox readonly");
		td.appendChild(input);
		tr.appendChild(td);
		
		td=document.createElement("td");
		input=document.createElement("input");
		input.setAttribute("type","text");
		input.setAttribute("maxLength","10");
		input.setAttribute("index",itemNum);
		input.setAttribute("name","amount_"+itemNum);
		input.setAttribute("id","amount_"+itemNum);
		input.setAttribute("value","0");
		input.style.cssText="text-align:right;width:60px;";
		input.setAttribute("className","TextBox");
		input.setAttribute("class","TextBox");
		input.onchange=elementOnChnage;
		td.appendChild(input);
		tr.appendChild(td);
		
		td=document.createElement("td");
		input=document.createElement("input");
		input.setAttribute("type","text");
		input.setAttribute("maxLength","10");
		input.setAttribute("index",itemNum);
		input.setAttribute("name","unit_price_"+itemNum);
		input.setAttribute("id","unit_price_"+itemNum);
		input.setAttribute("value","0");
		input.setAttribute("readOnly",true);
		input.setAttribute("className","TextBox readonly");
		input.setAttribute("class","TextBox readonly");
		input.style.cssText="text-align:right;width:60px";
		input.onchange=elementOnChnage;
		td.appendChild(input);
		tr.appendChild(td);
		
		td=document.createElement("td");
		input=document.createElement("input");
		input.setAttribute("type","text");
		input.setAttribute("maxLength","10");
		input.setAttribute("index",itemNum);
		input.setAttribute("name","cost_"+itemNum);
		input.setAttribute("id","cost_"+itemNum);
		input.setAttribute("value","0");
		input.setAttribute("readOnly",true);
		input.setAttribute("className","TextBox readonly");
		input.setAttribute("class","TextBox readonly");
		input.style.cssText="text-align:right;width:60px";
		input.onchange=elementOnChnage;
		td.appendChild(input);
		tr.appendChild(td);
		
		td=document.createElement("td");
		input=document.createElement("input");
		input.setAttribute("type","text");
		input.style.width="150px";
		input.setAttribute("maxLength","200");
		input.setAttribute("index",itemNum);
		input.setAttribute("name","mark_"+itemNum);
		input.setAttribute("id","mark_"+itemNum);
		input.setAttribute("value","");
		input.setAttribute("className","TextBox");
		input.setAttribute("class","TextBox");
		input.onchange=elementOnChnage;
		td.appendChild(input);
		tr.appendChild(td);
		
		td=document.createElement("td");
		var delLink=document.createElement("a");
		delLink.setAttribute("href","javascript:doItemDelete("+itemNum+");");
		delLink.appendChild(document.createTextNode("删除"));
		td.appendChild(delLink);
		
		input=document.createElement("input");
		input.setAttribute("type","hidden");
		input.setAttribute("name","status_"+itemNum);
		input.setAttribute("id","status_"+itemNum);
		input.setAttribute("value","UNCHANGE");
		td.appendChild(input);
		
		input=document.createElement("input");
		input.setAttribute("type","hidden");
		input.setAttribute("name","id_"+itemNum);
		input.setAttribute("id","id_"+itemNum);
		input.setAttribute("value","0");
		td.appendChild(input);
		tr.appendChild(td);

		tbl.appendChild(tr);
		document.getElementById("item_num").value=itemNum+1;
		return itemNum;//当前行的index
	}
	function doItemDelete(index){
		ShowConfirm('确认框','确定删除吗？',340,80,"doItemDeleteCallBack("+index+")");
	}
	function doItemDeleteCallBack(index){
		if(popRetVal!=null){
			document.getElementById("itemTr"+index).style.display="none";
			document.getElementById("status_"+index).value="DELETE";
			doCount();
			
			resizePopwin();
		}
	}
	function doInit(){
		showFormErrorMsg();
		resizePopwin();
	}
	function checkItemChange(index,name){
		if(document.getElementById("id_"+index).value=="" || document.getElementById("id_"+index).value=="0"){
			document.getElementById("status_"+index).value="NEW";
		}else{
			document.getElementById("status_"+index).value="EDIT";
		}
		
		var itemAmount=document.getElementById("amount_"+index).value;
		var itemUnitPrice=document.getElementById("unit_price_"+index).value;
		var itemCost=document.getElementById("cost_"+index).value;
		if(name=="amount_"+index){//数量改变
			if(!isNaN(itemAmount)){
				if(!isNaN(itemUnitPrice)){//有单价，计算金额
					itemCost=accMul(itemAmount,itemUnitPrice);
					document.getElementById("cost_"+index).value=parseScale(itemCost,2);
				}else if(!isNaN(itemCost) && (itemAmount-0)!=0){//有金额，计算单价
					document.getElementById("unit_price_"+index).value=parseScale(itemCost/itemAmount,4);
				}
			}
		}else if(name=="unit_price_"+index){//单价改变，计算金额
			if(!isNaN(itemUnitPrice) && !isNaN(itemAmount)){
				itemCost=accMul(itemAmount,itemUnitPrice);
				document.getElementById("cost_"+index).value=parseScale(itemCost,2);
			}
		}else if(name=="cost_"+index){//金额改变，计算单价
			if(!isNaN(itemCost) && !isNaN(itemAmount) && (itemAmount-0)!=0){
				document.getElementById("unit_price_"+index).value=parseScale(itemCost/itemAmount,4);
			}
		}
		
		doCount();
	}	
	function doCount(){
		var itemNum=document.getElementById("item_num").value-0;
		var itemCost;
		var itemAmount;
		var costTotal=0;
		var amountTotal=0;
		for(var i=0;i<itemNum;i++){
			if(document.getElementById("status_"+i).value!="DELETE"){
				if(document.getElementById("cost_"+i)!=null){
					itemCost=document.getElementById("cost_"+i).value;
					if(!isNaN(itemCost)){
						costTotal=addMul(costTotal,itemCost);
					}
				}
				if(document.getElementById("amount_"+i)!=null){
					itemAmount=document.getElementById("amount_"+i).value;
					if(!isNaN(itemAmount)){
						amountTotal=addMul(amountTotal,itemAmount);
					}
				}
			}
		}
		if(document.getElementById("amountSpan")!=null){
			document.getElementById("amountSpan").innerHTML=amountTotal;
		}
		if(document.getElementById("costSpan")!=null){
			document.getElementById("costSpan").innerHTML=costTotal;
		}
	}
	function selectManager(){
		var url="/base/StafferMainForSelect.ihtm";
		ShowIframeNoScroll("选择员工",url,800,520,"selectManagerCallBack()",1024,600);
	}
	function selectManagerCallBack(){
		if(popRetVal!=null){
			var arr=popRetVal.split(";");
			document.getElementById("alloBill.managerId").value=arr[0];
			document.getElementById("alloBill.managerName").value=arr[1];
		}
	}
	function doPrint(id){
		showWin(900,600,"/storehouse/AlloBillPrint.ihtm?id="+id);
	}
</script>
</head>
<body onload="doInit();">
<div class="Wrap">
	<form name="frm" method="post">
	<div class="Container">
		<div class="Contnet Paper">
			<c:set var="buttonDisabledStr" value="disabled='true'" /><!-- 保存按钮是否可点击 -->
			<c:set var="codeReadOnlyStr" value="" /><!-- 编码框是否可点击 -->
			<c:set var="codeReadOnlyClassStr" value="" /><!-- 编码框颜色 -->
	      	<c:set var="showCost" value="N" />
	      	<c:if test="${command.codeRule.generateRule!='MANUAL'}">
				<c:set var="codeReadOnlyStr" value="readonly='readonly'" />
				<c:set var="codeReadOnlyClassStr" value="disabled" />
			</c:if>
			<c:if test="${id==null || id==''}">
				<c:set var="pageTopTitle" value="新增调拨单" />
				<c:set var="buttonDisabledStr" value="" />
			</c:if>
			<c:if test="${id!=null && id!=''}">
				<c:set var="pageTopTitle" value="编辑调拨单" />
				<c:if test="${command.alloBill.enabled=='Y' && command.alloBill.examined=='N'}">
					<c:if test="${currentUser.user.userType==1 || fn:indexOf(currentUser.privs,';ALLO_BILL;')!=-1}">
						<c:set var="buttonDisabledStr" value="" /><!-- 未审核时有权限就可以修改 -->
					</c:if>
				</c:if>
			</c:if>
			
			<c:if test="${id==null || id=='' || currentUser.user.userType==1 || fn:indexOf(currentUser.privs,';ALLO_BILL;')!=-1 || fn:indexOf(currentUser.privs,';STOR_COST;')!=-1}">
				<c:set var="showCost" value="Y" />
			</c:if>
			
			<c:set var="dateEdit" value="Y" /><!-- 是否可以编辑日期 -->
			<c:if test="${currentUser.user.userType!=1 && fn:indexOf(currentUser.privs,';NO_BILL_DATE;')!=-1}">
				<c:set var="dateEdit" value="N" />
			</c:if>
			
			<!-- 提示信息 -->
			<%@ include file="../inc/BillPageTop.jsp"%>
			
			<!--单 标题-->
			<br>
	        <table class="BillHeading" cellspacing="0" cellpadding="0">
	        	<tr>
		            <td width="301px;" rowspan="2" ><div class="CorpLogo"><img src="${enterpriseInfo.loginImage}" /></div></td>
		            <td width="301px;" rowspan="2" ><h1>${pageTopTitle}</h1></td>
		            <td width="301px;" class="tr vb codeTd">
		                <span class="MustInput">*</span>编号：
		                <spring:bind path="command.alloBill.billCode">
				    	<input type="text" class="tbBillCode TextBox ${codeReadOnlyClassStr}" ${codeReadOnlyStr} maxlength="30" onKeyUp="goNextInput('alloDateStr');" id="${status.expression}" name="${status.expression}" value="${status.value}">
				    	<script language="javascript">
							setFormErrorMsg('<c:out value="${status.errorMessage}" />',1,'alloBill.billCode');
						</script>
			     		</spring:bind>
		            </td>
	        	</tr>
	        	<tr>
	            	<td class="tr" >
	            		<span id="calPosi"></span>
		            	<span class="MustInput">*</span>调拨日期：
		            	<spring:bind path="command.alloDateStr">
		                    <input type="text" class="tbBillDate_sim TextBox <c:if test="${dateEdit=='N'}">readonly</c:if>" maxlength="15" id="${status.expression}" name="${status.expression}" value="${status.value}" <c:if test="${dateEdit=='N'}">readonly="readonly"</c:if> />
		                    <c:if test="${dateEdit=='Y'}"><img src="/images/calendar.gif" class="imgIconButton" onClick="displayCalendar(document.getElementById('alloDateStr'),'yyyy-mm-dd',document.getElementById('calPosi'));"></c:if>
		                    <script language="javascript">
						    	setFormErrorMsg('<c:out value="${status.errorMessage}" />',2,'alloDateStr');
						    </script>
		                </spring:bind>
	            	</td>
	        	</tr>
	        </table>
			
			<!-- 单 头信息 -->
	        <div class="TopBottom_Border">
	        	<table class="BillHeadInfo" cellspacing="0" cellpadding="0">
	        		<tr>
	            		<th width="84px"><span class="MustInput">*</span>调出仓库：</th>
	            		<td width="200px">
	            			<spring:bind path="command.alloBill.fromStoId">
							<select id="${status.expression}" name="${status.expression}" style="width:140px">
								<option value="0">==请选择==</option>
								<c:forEach var="item" items="${fromStoList}">
									<option value="${item.id}" <c:if test="${status.value==item.id}">selected</c:if>>${item.stoName}</option>
								</c:forEach>
				  			</select>
						    <script language="javascript">
						    	setFormErrorMsg('<c:out value="${status.errorMessage}" />',3);
						    </script>
							</spring:bind>
	            		</td>
	            		<th width="84px"><span class="MustInput">*</span>调入仓库：</th>
	            		<td width="273px">
	            			<spring:bind path="command.alloBill.toStoId">
	            			<select id="${status.expression}" name="${status.expression}" style="width:140px">
								<option value="0">==请选择==</option>
								<c:forEach var="item" items="${toStoList}">
									<option value="${item.id}" <c:if test="${status.value==item.id}">selected</c:if>>${item.stoName}</option>
								</c:forEach>
				  			</select>
				          	<script language="javascript">
				          		setFormErrorMsg('<c:out value="${status.errorMessage}" />',4);
				          	</script>
				          	</spring:bind>
	            		</td>
	            		<th width="84px"><span class="MustInput">*</span>经办人：</th>
            			<td width="179px">
            				<spring:bind path="command.alloBill.managerName">
							<input type="text" class="tbInfo1 TextBox readonly" readonly="readonly" id="${status.expression}" name="${status.expression}" value="${status.value}">
							<img class="make-a" src="/images/make-a.gif" style="cursor:pointer;" onClick="selectManager();">
					      	</spring:bind>
					      	<spring:bind path="command.alloBill.managerId">
							<input type="hidden" id="${status.expression}" name="${status.expression}" value="${status.value}">
						    <script language="javascript">
						    	setFormErrorMsg('<c:out value="${status.errorMessage}" />',5);
						    </script>
							</spring:bind>
            			</td>
            		</tr>
	        	</table>
	        </div>
			
			<!-- 明细 -->
	        <input type="hidden" id="item_num" name="item_num" value="${fn:length(command.items)}">
	        <table id="BillDetails" class="BillDetails" width="100%" cellspacing="0" cellpadding="0">
	        	<tbody id="itemRowTbl">
				<tr>
					<th width="12%">材料编号</th>
					<th width="25%">品名规格</th>
					<th  width="8%">单位</th>
					<th width="10%">数量</th>
					<th width="10%">单价(元)</th>
					<th width="10%">金额(元)</th>
					<th width="20%">备注</th>
					<th width="5%">操作</th>
				</tr>
				<c:forEach var="item" items="${command.items}" varStatus="i">
				<tr id="itemTr${i.index}" <c:if test="${item.status=='DELETE'}">style="display:none"</c:if>>
					<td>
						<input type="text" class="TextBox readonly" readonly="readonly" style="width:80px" id="product_code_${i.index}" name="product_code_${i.index}" value="${item.productCode}">
					</td>
					<td>
						<input type="text" class="TextBox readonly" readonly="readonly" style="width:160px" id="product_name_${i.index}" name="product_name_${i.index}" value="<c:out value="${item.productName}" />" onmouseover="this.title=this.value">
						<img src="/images/icon_add.gif" style="cursor:pointer;" onClick="selectProduct(${i.index},'');" >
						<input type="hidden" id="product_id_${i.index}" name="product_id_${i.index}" value="${item.alloBillItem.productId}">
					</td>
					<td>
						<input type="text" class="TextBox readonly" readonly="readonly" style="width:40px" id="product_unit_${i.index}" name="product_unit_${i.index}" value="${item.unit}">
					</td>
					<td>
						<input type="text" class="TextBox" style="width:60px;text-align:right;"  maxlength="10" id="amount_${i.index}" name="amount_${i.index}" value="${item.amountStr}" onChange="checkItemChange(${i.index},this.id);">
					</td>
					<td>
						<c:if test="${showCost=='Y'}">
						<input type="text" class="TextBox readonly" readonly="readonly" style="width:60px;text-align:right;" maxlength="10" id="unit_price_${i.index}" name="unit_price_${i.index}" value="${item.unitPrice}" onChange="checkItemChange(${i.index},this.id);">
						</c:if>
					</td>
					<td>
						<c:if test="${showCost=='Y'}">
						<input class="TextBox readonly" readonly="readonly" type="text" style="width:60px;text-align:right;" maxlength="10" id="cost_${i.index}" name="cost_${i.index}" value='<commonTag:parseBigDecimal source="${item.alloBillItem.cost}" />'>
						</c:if>
					</td>
					<td>
						<input type="text" class="TextBox" style="width:150px" maxlength="200" id="mark_${i.index}" name="mark_${i.index}" value="${item.alloBillItem.mark}" onChange="checkItemChange(${i.index},this.id);">
					</td>
					<td>
						<a href="javascript:doItemDelete(${i.index});">删除</a>
						<input type="hidden" id="status_${i.index}" name="status_${i.index}" value="${item.status}">
						<input type="hidden" id="id_${i.index}" name="id_${i.index}" value="${item.oldId}">
					</td>
				</tr>
				</c:forEach>
				</tbody>
			</table>
			<div class="table-bot" style="margin-top:4px">
				<span style="float:right;PADDING-RIGHT:10px;color:#aaa">
					数量小计：<span id="amountSpan"><commonTag:parseBigDecimal source="${command.amount}" /></span>&nbsp;
					<c:if test="${showCost=='Y'}">
						金额小计：<span id="costSpan"><commonTag:parseBigDecimal source="${command.cost}" /></span>元
					</c:if>
				 </span>
				<c:if test="${buttonDisabledStr==''}">
					<a href="javascript:doMultiSelect();">新增调拨明细</a>
				</c:if>
			</div>					      
			<br>
			<spring:bind path="command.items">
	          	<script language="javascript">
	          		setFormErrorMsg('<c:out value="${status.errorMessage}" />',6);
	          	</script>
      		</spring:bind>
			
			<!-- 附加信息 -->
	        <div class="TopBottom_Border">
	        	<table class="BillElseInfo" cellspacing="0" cellpadding="0">
	        		<tr>
	            		<th width="84px">摘要：</th>
	            		<td width="820px">
	            			<spring:bind path="command.alloBill.description">
							<textarea id="${status.expression}" name="${status.expression}" class="TextBox" style="width:680px;height:40px">${status.value}</textarea>
							<script language="javascript">
				          		setFormErrorMsg('<c:out value="${status.errorMessage}" />',7,'alloBill.description');
				          	</script>
							</spring:bind>
	            		</td>
	        		</tr>
	        		<tr>
	            		<th width="84px">备注：</th>
	            		<td width="820px">
	            			<spring:bind path="command.alloBill.mark">
							<textarea id="${status.expression}" name="${status.expression}" class="TextBox" style="width:680px;height:40px">${status.value}</textarea>
							<script language="javascript">
				          		setFormErrorMsg('<c:out value="${status.errorMessage}" />',8,'alloBill.mark');
				          	</script>
							</spring:bind>
	            		</td>
	        		</tr>
	        	</table>
	        </div>
	        <br>
	        <div class="BillNotes">
                <span>开单人：${command.alloBill.createrName} <c:if test="${command.alloBill.createTime!=null}"><fmt:formatDate value="${command.alloBill.createTime}" pattern="yyyy-MM-dd HH:mm"/></c:if></span>
        		<span>审核人：<c:if test="${command.alloBill.examinerId!=0}">${command.alloBill.examinerName} <c:if test="${command.alloBill.examineTime!=null}"><fmt:formatDate value="${command.alloBill.examineTime}" pattern="yyyy-MM-dd HH:mm"/></c:if></c:if></span>
				<span>单据帐套：${command.tallySetName}</span>
				<spring:bind path="command.alloBill.tallySetId">
			    	<script language="javascript">
			          	setFormErrorMsg('<c:out value="${status.errorMessage}" />',1);
			    	</script>
				</spring:bind>
			</div>
		</div>
		
		<!-- 底栏按钮 -->
		<div class="Footer">
			<div id="buttonDiv">
				<input type="button" class="buttom-a" value=" 保 存 " onClick="doSave('0');" ${buttonDisabledStr}>
				<c:if test="${id==null || id==''}">
					<input type="button" class="buttom-a" value="保存并新增" onClick="doSave('1');" ${buttonDisabledStr}>
				</c:if>
				<c:if test="${id!=null && id!=''}">
					<input type="button" class="buttom-a" value=" 打 印 " onClick="doPrint(${id});">
				</c:if>
				<input type="button" class="buttom-a" value=" 取 消 " onClick="doCancel();">
				<input type="hidden" id="continue_flag" name="continue_flag" value="0">
				<input type="hidden" id="examine" name="examine" value="0">
				<spring:bind path="command.sychronizeValue"><input type="hidden" id="${status.expression}" name="${status.expression}" value="${status.value}"></spring:bind>
			</div>
			<div id="waitDiv" style="display:none">
    			<span>请稍候...</span>
			</div>
		</div>
		
	</div>
	</form>
</div>
<%@ include file="../inc/LoadingDiv.jsp"%>
</body>
</html>
